﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.FastFourierTransform
{
	public class ChebyshevDerivativeMatrix<T> : LinearSystem.IMultiDimensionalArray<T>
	{
		public int Rank { get; set; }
		#region IMultiDimensionalArray<T> Members

		public T this[params int[] index]
		{
			get
			{
				int distance = index[1] - index[0];
				if (distance <= 0 || distance % 2 == 0)
				{
					return (T)(dynamic)0;
				}
				else
				{
					if (index[0] == 0) return (T)(dynamic)(index[1]);
					else return (T)(dynamic)(2 * index[1]);
				}
			}
			set
			{
				throw new NotSupportedException();
			}
		}

		public int GetLength(int DimensinNumber)
		{
			return Rank + 1;
		}

		public int Dimension
		{
			get { return 2; }
		}

		#endregion
	}
}
